• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

Search results

  1. Eifie

    Javascript type error: variable supposedly undefined even though I've initialised it

    That was why I suggested putting the log statement right before the variable assignment... weird that the form was present in the output. :unsure:
  2. Eifie

    Javascript type error: variable supposedly undefined even though I've initialised it

    I doubt it has to do with the function; you're trying to set the onsubmit property of something undefined, which raises an error. (btw, is it supposed to be onSubmit? I'm not sure about vanilla JavaScript)
  3. Eifie

    Javascript type error: variable supposedly undefined even though I've initialised it

    The most likely explanation is that there isn't actually a form with the given name at the time you're assigning that variable, so indexing into the table with that name just gives you undefined. You could try adding console.log(document.forms); right before the variable assignment and then...
Back
Top Bottom